import type { EmojiApi } from "undraw-ui"

export interface ConfigApi {
    user: UserApi
    emoji: EmojiApi
    comments: CommentApi[]
}

export interface CommentApi {
    id: number  //评论id
    parentId: number | null //父评论id
    uid: number    //用户id
    username: string //用户名
    avatar: string  //用户名头像
    level: number   //用户等级
    link: string    //跳转链接
    address: string //用户地址
    content: string //评论内容
    like: number  //点赞数量
    createTime: string // 评论时间
    reply?: ReplyApi | null //是否有子评论
}
//提交评论
export interface  PostComment{
    nid:string, //评论文章id
    content:string //用户评论内容
    ip:string,//用户ip地址
    pid?:number,//文章跟评论
}

export interface UserApi {
    id: number
    username: string
    avatar: string
    likeIds: string[]
}

export interface ReplyApi {
    total: number;
    list: CommentApi[]
}

export interface ReplyPageParam {
  parentId: string
  pageNum: number
  pageSize: number
  finish: (comments: CommentApi[]) => void
}

export interface ReplyParam {
    replyMore: (parentId: number, closeLoad: Function) => void
    replyPage: (parentId: string, pageNum: number, pageSize: number, finish: (comments: CommentApi[]) => void) => void
}